package com.MuApk.box;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import java.io.IOException;
import android.content.ClipboardManager;
import android.content.ClipData;
import android.content.Context;
import android.widget.Toast;

public class LockActivity extends Activity { 

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.lock);
    }
	public void kfbn(View view){
        String packages="com.MuApk.box";
        String path="/data/data/"+packages+"/";
        String qx="777";
        chmod(qx,path);
        String s =path;
        //获取剪贴板管理器：
        ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
        // 创建普通字符型ClipData
        ClipData mClipData = ClipData.newPlainText("Label", s);
        // 将ClipData内容放到系统剪贴板里。
        cm.setPrimaryClip(mClipData);
        Toast.makeText(this, "目录已开放，请使用同一文件管理器进行文件操作！", Toast.LENGTH_LONG).show();
    }
    public void ycbn(View view){
            String packages="com.MuApk.box";
            String path="/data/data/"+packages+"/";
            String qx="770";
            chmod(qx,path);
            Toast.makeText(this, "目录已隐藏！", Toast.LENGTH_LONG).show();
    }
    public static void chmod(String permission, String path) {
        try {
            String command = "chmod " + permission + " -R " + path;
            Runtime runtime = Runtime.getRuntime();
            runtime.exec(command);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} 
